
#====== test auto definition ========
function(test test_NAME test_SOURCES)
    set(test_RESOURCES ${ARGV2})
        if(test_RESOURCES)
            add_executable(${test_NAME}_test
                {test_SOURCES} ${test_RESOURCES})
        else(test_RESOURCES)
            add_executable(${test_NAME}_test
                ${test_SOURCES})    
        endif(test_RESOURCES)
    

    target_link_libraries(${test_NAME}_test gmock)    
    target_link_libraries(${test_NAME}_test pthread)
    target_link_libraries(${test_NAME}_test hfsme)
    
    add_test(${test_NAME} ${test_NAME}_test)
    add_dependencies(check ${test_NAME}_test)
endfunction(test)
